<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/bom/bom/BOM_Foundation.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/bom/bom/BOM_Foundation.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ID',
                footer: "Foots",
                cnName: 'Bom基础',
                name: 'bom/BOM_Foundation',
                url: "/BOM_Foundation/",
                sortName: "ID"
            });
            const editFormFields = ref({"BomNumber":"","BomTheme":"","DefaultBom":[],"Version":"","ProductName":"","FinishedProduct":"","DailyProduction":"","Notes":"","Text":"","Upload":""});
            const editFormOptions = ref([[{"title":"BOM编号","required":true,"field":"BomNumber","type":"text"},
                               {"title":"BOM主题","required":true,"field":"BomTheme","type":"text"}],
                              [{"dataKey":"sfqy","data":[],"title":"默认BOM","required":true,"field":"DefaultBom","type":"checkbox"},
                               {"title":"版本","required":true,"field":"Version","type":"text"}],
                              [{"title":"成品名称","required":true,"field":"ProductName","type":"text"},
                               {"dataKey":"aaa","data":[],"title":"成品类型","required":true,"field":"FinishedProduct","type":"select"}],
                              [{"title":"日产量","field":"DailyProduction","type":"text"}],
                              [{"title":"备注","field":"Notes","type":"textarea"}],
                              [{"title":"新建文本文档.PDF","field":"Text","type":"text"}],
                              [{"title":"上传","field":"Upload","type":"text"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'ID',title:'基础ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'BomNumber',title:'BOM编号',type:'string',width:110,require:true,align:'left',sort:true},
                       {field:'BomTheme',title:'BOM主题',type:'string',width:110,require:true,align:'left'},
                       {field:'DefaultBom',title:'默认BOM',type:'int',bind:{ key:'sfqy',data:[]},width:110,require:true,align:'left'},
                       {field:'Version',title:'版本',type:'int',width:110,require:true,align:'left'},
                       {field:'ProductName',title:'成品名称',type:'string',width:110,require:true,align:'left'},
                       {field:'DailyProduction',title:'日产量',type:'string',width:110,align:'left'},
                       {field:'Notes',title:'备注',type:'string',width:110,align:'left'},
                       {field:'Text',title:'新建文本文档.PDF',type:'string',width:110,align:'left'},
                       {field:'Upload',title:'上传',type:'string',width:110,align:'left'},
                       {field:'CreateID',title:'创建人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:130,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'ModifyID',title:'最后修改人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Modifier',title:'最后修改人',type:'string',width:130,align:'left'},
                       {field:'ModifyDate',title:'最后修改人时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'FinishedProduct',title:'成品类型',type:'string',bind:{ key:'aaa',data:[]},width:120,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
